import service from "@/utils/request";
export const useCesQueryApi = (code?: string) => {
  return service({
    url: `/v0/ces/query`,
    method: "GET",
    params: { code },
  });
};
export const useCesCreateApi = (formData: object) => {
  return service({
    url: `v0/ces/create`,
    method: "POST",
    data: formData,
  });
};
export const useCesUpdateApi = (formData: object) => {
  return service({
    url: `v0/ces/update`,
    method: "PUT",
    data: formData,
  });
};

export const useCesDeleteApi = (param: string | string[]) => {
  let arrList: string[] = [];

  if (param instanceof Array) {
    arrList = param;
  } else {
    arrList.push(param);
  }

  return service({
    url: `v0/ces/delete`,
    method: "DELETE",
    data: { codeList: arrList },
  });
};
